<?php
/**
 *  Create On 2014-12-27
 *  Author yiwei
 *  QQ:1006629314
 **/
class MessageController extends Controller{
	
	public function __construct() {
		parent::__construct ();
		$this->view->web_host = $this->getRequest ()->hostUrl;
		$this->view->web_app_url = $this->getRequest ()->hostUrl . "/clientapi.php";

	}
	
	
	public function getMessageList(){
		$userinfo = $this->getData ( 'userinfo' );
		$user_id = $userinfo ['id'];
		$user_id = 23;
		$message = new message();
		$data = $message->receiveMessage($user_id);
		//var_dump($data);
		if($data){
			$this->view->setData ( $data );
			$this->view->setState ( "1" );
			$this->view->setMsg ( "获取消息列表成功~" );
		}else{
			$this->view->setData ((object)null );
			$this->view->setState ( "0" );
			$this->view->setMsg ( "没有更多了哟!" );
		}
		$this->view->display ( "json" );
	}
	
}